<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">


<link href="<%=request.getContextPath() %>/css/style.css"
	rel="stylesheet" type="text/css" />
<script type="text/javascript"
	src="<%=request.getContextPath() %>/js/jquery.js"></script>

<script type="text/javascript">
$(document).ready(function(){
  $(".click").click(function(){
  $(".tip").fadeIn(200);
  });
  
  $(".tiptop a").click(function(){
  $(".tip").fadeOut(200);
});

  $(".sure").click(function(){
  $(".tip").fadeOut(100);
});

  $(".cancel").click(function(){
  $(".tip").fadeOut(100);
});

});
</script>


</head>


<body>
<c:if test="${empty currentUser}">
<jsp:include page="../404.jsp"/>
</c:if>
<c:if test="${!empty currentUser}">

	<div class="place">
		<span>位置：</span>
		<ul class="placeul">
			<li><a href="">首页</a></li>
			<li><a href="">数据表</a></li>
			<li><a href="">用户咨询</a></li>
		</ul>
	</div>

	<div class="rightinfo">
		<table class="tablelist">
			<thead>
				<tr>
					<th>编号</th>
					<th>注册用户姓名</th>
					<th>问题描述</th>
					<th>帮助</th>
					<th>提问时间</th>
					<th>回复提问</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${adviceForUser}" var="adviceForUser" varStatus="status">
					<tr>
					<td>${adviceForUser.problemId}</td>
				<c:forEach items="${user}" var="user">
					<c:if test="${adviceForUser.userId==user.id}">
						<td>${user.reguser}</td>
					</c:if>
						</c:forEach>	
						<td>${adviceForUser.problem}</td>
						<td>${adviceForUser.getHelp}</td>
						<td>${adviceForUser.questDate}</td>
						<td><a href="${pageContext.request.contextPath }/advice/quest/${adviceForUser.problemId}">回复</a></td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
		<div class="pagin">
			<div class="message">
				共<i class="blue">${page.totalPageCount}</i>页，当前显示第&nbsp;<i
					class="blue">${page.pageNow}&nbsp;</i>页
			</div>
			<ul class="paginList">
				<li class="paginItem"><a
					href="${pageContext.request.contextPath }/advice/advicelist?pageNow=1">首页</a></li>
				<c:choose>
					<c:when test="${page.pageNow - 1 > 0}">
						<li class="paginItem"><a
							href="${pageContext.request.contextPath }/advice/advicelist?pageNow=${page.pageNow - 1}"></a><span
							class="pagepre"></span></li>

					</c:when>
					<c:when test="${page.pageNow - 1 <= 0}">
						<li class="paginItem"><a
							href="${pageContext.request.contextPath }/advice/advicelist?pageNow=1"></a><span
							class="pagepre"></span></li>
					</c:when>
				</c:choose>



				<c:choose>
					<c:when test="${page.pageNow + 1 < page.totalPageCount}">
						<li class="paginItem"><a
							href="${pageContext.request.contextPath }/advice/advicelist?pageNow=${page.pageNow + 1}"></a><span
							class="pagenxt"></span></li>
					</c:when>
					<c:when test="${page.pageNow + 1 >= page.totalPageCount}">
						<li class="paginItem"><a
							href="${pageContext.request.contextPath }/advice/advicelist?pageNow=${page.totalPageCount}"></a><span
							class="pagenxt"></span></li>
					</c:when>
				</c:choose>
				<li class="paginItem"><a
					href="${pageContext.request.contextPath }/advice/advicelist?pageNow=${page.totalPageCount}">尾页</a></li>
			</ul>
		</div>
		</div>
		</c:if>
	<script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
	

	</script>

</body>
</html>
